home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / BBS / MUBBS / Tfiles10.cpt / textfiles Code / Text Misc.c next >
Text File  |  1992-01-18  |  3KB  |  120 lines

  1. /*
  2.  *  MUBBS misc.c
  3.  *
  4.  *    This program source code and it's compiled version is
  5.  *  Copyright (c) 1991 N. Hawthorn.
  6.  *  This program source code and it's compiled version IS NOT IN THE
  7.  *  PUBLIC DOMAIN ! Please read the "COPYRIGHT NOTICE / NH" file for details
  8.  *  regarding use of this program source code and it's compiled version.
  9.  *
  10.  *
  11.  * Code to make your life eaiser !
  12.  *
  13.  */
  14.  
  15. #define INMUBBSMISC
  16.  
  17. #include "MUBBS Module.h"
  18.  
  19.  
  20.  
  21. /* these are all the routines that you can call, some of them are to */
  22. /* be used carefully. See the accompanying documentation before use ! */
  23. /* Don't worry about the "godoit" stuff here, just see the examples   */
  24.  
  25.  
  26. send()        { ProcPtr hh; G->S=0; godoit; }
  27. print()        { ProcPtr hh; G->S=1; godoit; }
  28. sendtext()    { ProcPtr hh; G->S=2; godoit; }
  29. wait()        { ProcPtr hh; G->S=3; godoit; }
  30. cmd1()        { ProcPtr hh; G->S=4; godoit; }
  31. cmd1noecho(){ ProcPtr hh; G->S=5; godoit; }
  32. sendnc()    { ProcPtr hh; G->S=6; godoit; }
  33. showline()    { ProcPtr hh; G->S=7; godoit; }
  34. clock()        { ProcPtr hh; G->S=8; godoit; }
  35. portsin()    { ProcPtr hh; G->S=9; godoit; }
  36. passportsin(){ ProcPtr hh; G->S=10; godoit; }
  37. module()    { ProcPtr hh; G->S=11; godoit; }
  38. gettime()    { ProcPtr hh; G->S=12; godoit; }
  39. switchuser(){ ProcPtr hh; G->S=13; godoit; }
  40.  
  41. fopen()        { ProcPtr hh; G->S=14; godoit; }
  42. fclose()    { ProcPtr hh; G->S=15; godoit; }
  43. fread()        { ProcPtr hh; G->S=16; godoit; }
  44. fwrite()    { ProcPtr hh; G->S=17; godoit; }
  45. ftell()        { ProcPtr hh; G->S=18; godoit; }
  46. fsetpos()    { ProcPtr hh; G->S=19; godoit; }
  47. fgetpos()    { ProcPtr hh; G->S=20; godoit; }
  48. fseek()        { ProcPtr hh; G->S=21; godoit; }
  49. freopen()    { ProcPtr hh; G->S=22; godoit; }
  50. fputs()        { ProcPtr hh; G->S=23; godoit; }
  51. fputc()        { ProcPtr hh; G->S=24; godoit; }
  52. fgetc()        { ProcPtr hh; G->S=25; godoit; }
  53. fgets()        { ProcPtr hh; G->S=26; godoit; }
  54. fflush()    { ProcPtr hh; G->S=27; godoit; }
  55. fprintf()    { ProcPtr hh; G->S=28; godoit; }
  56. fscanf()    { ProcPtr hh; G->S=29; godoit; }
  57. clearerr()    { ProcPtr hh; G->S=30; godoit; }
  58. scanf()        { ProcPtr hh; G->S=31; godoit; }
  59. sscanf()    { ProcPtr hh; G->S=32; godoit; }
  60. sprintf()    { ProcPtr hh; G->S=33; godoit; }
  61. rewind()    { ProcPtr hh; G->S=34; godoit; }
  62. rename()    { ProcPtr hh; G->S=35; godoit; }
  63. remove()    { ProcPtr hh; G->S=36; godoit; }
  64. ungetc()    { ProcPtr hh; G->S=37; godoit; }
  65. puts()        { ProcPtr hh; G->S=38; godoit; }
  66. perror()    { ProcPtr hh; G->S=39; godoit; }
  67. otheruser()    { ProcPtr hh; G->S=40; godoit; }
  68. mackey()    { ProcPtr hh; G->S=41; godoit; }
  69. loguser()    { ProcPtr hh; G->S=42; godoit; }
  70. printout()    { ProcPtr hh; G->S=43; godoit; }
  71. versionck()    { ProcPtr hh; G->S=44; godoit; }
  72.  
  73.  
  74.  
  75. /* These two routines change string formats from C to Pascal and back
  76.  
  77. PtoCstr(tstring); where are these located ?? in C or Mac ????
  78. CtoPstr(tstring); this one returns a pointer ??
  79.  
  80. */
  81.  
  82. /* You can use these routines to switch things around if you want, they are */
  83. /* already written for you ! */
  84.  
  85. pStrCopy( p2, p1 )
  86. char *p2, *p1;
  87. /* copies a pascal string from p1 to p2 */
  88. {
  89.     int len;
  90.     
  91.     len = *p2++ = *p1++;
  92.     while (--len>=0) *p2++=*p1++;
  93. }
  94.  
  95. long strcatc(str,c) /* appends a character to a string */
  96. char *str,c;
  97. {
  98. char n[2];
  99. n[0]=c;
  100. n[1]=0;
  101.     strcat(str,n) ;
  102. }
  103. /*    end of function        */
  104.  
  105. strtoint(str)
  106. char *str;
  107.     {
  108. short n=0;
  109.     sscanf(str,"%d",&n) ;
  110.     return(n);
  111.     }
  112. /*    end of function        */
  113.  
  114. inttostr(n,str)
  115. char *str;
  116. short n;
  117.     {
  118.     sprintf(str,"%d",n) ;
  119.     }
  120. /*    end of function        */